Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: install pkg-config for PyMySQL compatibility #894

Merged
merged 2 commits into from
Jul 6, 2023

Conversation

leangseu-edx
Copy link
Contributor

@leangseu-edx leangseu-edx commented Jul 6, 2023

Dockerfile Outdated
@@ -4,7 +4,7 @@ FROM ubuntu:focal as app

RUN apt-get update && \
apt-get upgrade -qy && apt-get install language-pack-en locales git \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
apt-get upgrade -qy && apt-get install language-pack-en locales git \
apt-get upgrade -qy && DEBIAN_FRONTEND=noninteractive apt-get install language-pack-en locales git \

Otherwise the docker build will ask for input and hang. (See notes in edx/edx-arch-experiments#349)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, passing --no-install-recommends to apt-get install might be even better, since tzdata was only a recommended transitive dependency. If it works, it's a good idea, since it will shrink your image sizes. But there's some chance you're depending on a recommended package without realizing it; up to you whether the risk is worth it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had success building the image with DEBIAN_FRONTEND=noninteractive. The problem is, I am not sure how to test these image. I do not want to take change on thing I can't test.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, DEBIAN_FRONTEND=noninteractive should be safe. If xqueue is not something you can readily test, it's probably not worth shrinking the image size.

@@ -4,7 +4,7 @@ FROM ubuntu:focal as app

RUN apt-get update && \
apt-get upgrade -qy && apt-get install language-pack-en locales git \
python3.8-dev python3-virtualenv libmysqlclient-dev libssl-dev build-essential wget unzip -qy && \
python3.8-dev python3-virtualenv libmysqlclient-dev libssl-dev build-essential pkg-config wget unzip -qy && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth adding a comment to explain what these dependencies are for.

Suggested change
python3.8-dev python3-virtualenv libmysqlclient-dev libssl-dev build-essential pkg-config wget unzip -qy && \
python3.8-dev python3-virtualenv \
# mysqlclient build dependencies
libmysqlclient-dev libssl-dev build-essential pkg-config \
wget unzip -qy && \

Copy link
Contributor

@timmc-edx timmc-edx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should work. Remaining suggestions are optional. :-)

Copy link
Contributor

@mattcarter mattcarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved

@leangseu-edx leangseu-edx merged commit fe8c57b into master Jul 6, 2023
@leangseu-edx leangseu-edx deleted the lk/dockerfile-pkg-config branch July 6, 2023 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants